<?php
/**
 * Simple resource plugin that allows us to configure an instance of Zend_Service_Recaptcha
 * 
 * @author Michael Krotscheck
 */
class Core_Application_Resource_Recaptcha
	extends Zend_Application_Resource_ResourceAbstract
{
	/**
	 * Defined by Zend_Application_Resource_Resource
	 *
	 * @return Zend_Service_ReCaptcha
	 */
	public function init()
	{
		$options = $this->getOptions();
		$recaptcha = new Zend_Service_ReCaptcha($options['publicKey'], $options['privateKey']);
		
		if ( isset($options['options']))
		{
			$recaptcha->setOptions($options['options']);
		}
		
		return $recaptcha;
	}
}